package com.wxg.config.alimq;

import com.wxg.domain.MqConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.stereotype.Component;

/**
 * @author void
 * @date 2019/12/30 9:58
 * @desc 阿里云收费版本rocketmq
 */
@Slf4j
@Component
public class AliRocketCondition implements Condition {

    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        if(conditionContext.getEnvironment().getProperty("mq.type").matches(MqConstant.MqType.alirocket.name())){
            return true;
        }
        return false;
    }
}
